// 视图组件
const view = {
  tabs: () => import('@/layouts/tabs'),
  blank: () => import('@/layouts/BlankView'),
  page: () => import('@/layouts/PageView')
}

// 路由组件注册
const routerMap = {
  root: {
    path: '/',
    name: '首页',
    redirect: '/login',
    component: view.tabs
  },
  dashboard: {
    name: 'Dashboard',
    component: () =>
      import('@/views/dashboard/index'),
  },
  users: {
    path: 'users',
    name: '用户管理',
    meta: {
      icon: 'user'
    },
    component: view.page,
  },

  sellers: {
    path: 'sellers',
    name: '商户列表',
    component: () => import('@/views/seller/index'),
    meta: {
      addBtn: true
    }
  },
  agencies: {
    path: 'agencies',
    name: '代理列表',
    component: () => import('@/views/agency/index'),
    meta: {
      addBtn: true
    }
  },
  members: {
    path: 'members',
    name: '用户列表',
    component: () => import('@/views/member/index')
  },
  sub: {
    path: 'sub-account',
    name: '管理员',
    component: () =>
      import('@/views/sub-account'),
    meta: {
      addBtn: true
    }
  },
  logs: {
    path: 'logs',
    name: '操作日志',
    component: () => import('@/views/logs')
  },

  order: {
    path: 'order',
    name: '订单管理',
    meta: {
      icon: 'shopping'
    },
    component: view.page,
  },
  buy: {
    path: 'buy',
    name: '商户订单',
    component: () => import('@/views/buy')
  },
  'buy-waiting-timeout': {
    path: 'buy-waiting-timeout',
    name: '超时订单',
    component: () => import('@/views/buy-waiting-timeout')
  },
  sell: {
    path: 'sell',
    name: '用户订单',
    component: () => import('@/views/sell')
  },
  callback: {
    path: 'callback',
    name: '异步通知',
    component: () => import('@/views/callback')
  },
  details: {
    path: 'details',
    name: '账变明细',
    component: () => import('@/views/details')
  },
  account: {
    path: 'account',
    name: '财务管理',
    meta: {
      icon: 'transaction'
    },
    component: view.page,
  },

  "agency-account": {
    path: 'agencys',
    name: '代理统计',
    component: () => import('@/views/agency-account')
  },
  "seller-account": {
    path: 'sellers',
    name: '商户统计',
    component: () => import('@/views/seller-account')
  },

  "member-account": {
    path: 'members',
    name: '用户统计',
    component: () => import('@/views/member-account')
  },

  config: {
    path: 'config',
    name: '设置',
    meta: {
      icon: 'control'
    },
    component: view.page,
  },
  system: {
    path: 'system',
    name: '系统设置',
    component: () => import('@/views/system')
  },
  password: {
    path: 'password',
    name: '登录密码',
    component: () =>
      import('@/views/password/reset')
  },
  "api-switch": {
    // path: 'password',
    // name: '登录密码',
    // component: () =>
    //   import('@/views/password/reset'),

    path: 'api-switch',
    name: 'API开关',
    component: () =>
      import('@/views/api-switch.vue')
  }

}
export default routerMap

